﻿function loadDHBC() {
    document.getElementById("game_area").innerHTML = '<div id="loading"><div id="loading-center-absolute"><div class="object w3-text-teal" id="object_four"></div><div class="object w3-text-teal" id="object_three"></div><div class="object w3-text-teal" id="object_two"></div><div class="object w3-text-teal" id="object_one"></div></div></div>';
    var xhttp;
    xhttp = new XMLHttpRequest();
    xhttp.onreadystatechange = function () {
        if (xhttp.readyState == 4 && xhttp.status == 200) {
            document.getElementById("game_area").innerHTML = xhttp.responseText;
        }
    };
    xhttp.open("GET", "../ajax/asp/Game/DHBC.aspx", true);
    xhttp.send();
}

$(document).ready(function () {
    $("#game-choose").on("change", function () {
        var game_type = document.getElementById("game-choose").value;
        if(game_type==1)
        {
            loadDHBC();
        }
        else
        {
            document.getElementById("game_area").innerHTML = "";
        }
    })
})